Conversation
|
|
||
| // compute restricted ranges (ignore headings in these ranges) | ||
| const isWithinIgnoredRange = isWithinRange(tokens, token => isCallout(token) || isTheorem(token) || isProof(token)); | ||
| const isWithinIgnoredRange = isWithinRange(tokens, isDiv); |
There was a problem hiding this comment.
Let me make things fun (of the type 3 variety).
What should we do about conditional content divs? (to say nothing of arbitrary Lua filters...)
There was a problem hiding this comment.
The behavior of conditional content divs is that the div itself will never actually appear in the resulting document. But if the conditions are met, then the contents will be included in the document, and headers inside will "move one level up".
There was a problem hiding this comment.
You always find and share the most interesting case! 😅
Level 3 indeed... How can we handle those indeed...
There was a problem hiding this comment.
Well gosh. I could probably hack together some checks for that in this code... but should I?
There was a problem hiding this comment.
@vezwork No, I don't think that's the best move. Let's merge this as is and talk about a redesign for later.
There was a problem hiding this comment.
I've realized that this PR doesn't actually address the regression. There is a deeper issue that probably is best resolved by deferring outline stuff to the CLI.
|
Closing this PR, it is not a proper fix of the issue. |
Fixes #829edit: this doesn't fix the more subtle issue I added to the bottom of #829. That seems to be a parser issue...
Some headers inside divs were already being excluded, but the exclusion rules were too conservative. The exclusions checked if the header was inside a callout (a div with a class that starts with
callout-), a Theorem (a div with a theorem-specific id), or a Proof (a div with a proof-specific id). Now it excludes all headers inside any div.